package hbsk;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ddd {
	 private final static String URL = "jdbc:sqlserver://localhost;DatabaseName=hbsk";
	    private static final String USER="sa";
	    private static final String PASSWORD="admin123";
	    private static Connection conn=null;
	    
	    
	    public static void main(String[] args) {
	    	  try {
	              //1.加载驱动程序
	              Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
	              //2.获得数据库的连接
	              conn=(Connection)DriverManager.getConnection(URL,USER,PASSWORD);
	              System.out.println(conn);
	          } catch (ClassNotFoundException e) {
	              e.printStackTrace();
	          } catch (SQLException e) {
	              e.printStackTrace();
	          }
		}
	

}
